Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cp: Support copying FIFOs with -r #3032

Merged
merged 7 commits into from
Mar 3, 2022
Merged

cp: Support copying FIFOs with -r #3032

merged 7 commits into from
Mar 3, 2022

Conversation

water-ghosts
Copy link
Contributor

This pull request handles the GNU test cp/special-f, which uses cp -R fifo e to copy a FIFO.

I noticed that this test was not only failing, but taking about 4 minutes to fail, which is an appreciable amount of the total test suite time. If I understand this correctly, uutils ignored the -r flag and tried to copy the contents of the (empty) FIFO instead of the FIFO itself; it kept waiting for something to read until eventually timing out.

Since Rust doesn't natively support copying FIFOs (see issue #1710), I implemented this by creating a new FIFO with the destination name. There's definitely room to improve on this (e.g. copying file permissions), but I experimented a bit and it doesn't seem like GNU's copies are much more than new instances, so I don't think this is too bad.

I'm still pretty new to this project and Rust in general, so let me know if there's a better way to go about this. I'm happy to either revise this PR or close it and create an issue if you'd prefer to solve this another way 🙂

@sylvestre
Copy link
Contributor

excellent:
Changes from main: PASS +3 / FAIL -3 / ERROR +0 / SKIP +0

@sylvestre sylvestre merged commit eace4bc into uutils:main Mar 3, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants